using System.Collections.Generic;
using System.ComponentModel;

namespace AvalonAdmin.BaseViewModel
{
    /// <summary>
    /// 选择功能视图模型接口
    /// </summary>
    /// <typeparam name="T">数据类型</typeparam>
    public interface ISelectionViewModel<T> : INotifyPropertyChanged
    {
        /// <summary>
        /// 是否全选
        /// </summary>
        bool IsAllSelected { get; set; }

        /// <summary>
        /// 是否有选中项
        /// </summary>
        bool HasSelectedItems { get; }

        /// <summary>
        /// 获取选中的项目
        /// </summary>
        /// <returns></returns>
        List<T> GetSelectedItems();

        /// <summary>
        /// 全选/取消全选
        /// </summary>
        void ToggleSelectAll();

        /// <summary>
        /// 选中项目
        /// </summary>
        /// <param name="item">项目</param>
        void SelectItem(T item);

        /// <summary>
        /// 更新全选状态
        /// </summary>
        void UpdateAllSelectedState();
    }
}